package tw.edu.tku.im.maze;
import org.json.JSONException;
import org.json.JSONObject;


public class EnterRoomRepParser extends PacketParser {
   public static EnterRoomRepParser INSTANCE = new EnterRoomRepParser();

   private EnterRoomRepParser() { }
   
   @Override
   public EnterRoomRep parse(JSONObject jsonObj) throws JSONException {
      JSONObject result = jsonObj.getJSONObject("result");
      int state = result.getInt("state");
      return new EnterRoomRep(state);
   }

   @Override
   public String acceptName() {
      return "enterRoomResponse";
   }
}
